#include <iostream> 
#include <algorithm> 
#include <limits>
#include "doublelinkedlist.h"
using namespace std;
typedef int Object;
List <Object >:: iterator
find ( List <Object >& _list , Object & _val );
int main(){
	typedef int Object;
	List<int> L;
	int test=3;
	L.push_back(1);
	L.push_back(2);
	L.push_back(3);
	L.push_back(4);
	L.push_back(5);
	L.print();
	cout<<endl;
	List<int>::iterator iter = find(L,test);
	L.erase(iter);
	L.print();
	cout<<endl;
	List<int>::iterator iter2 = find(L,test);	
	return 0;
}
List <Object >::iterator
find(List<Object>& _list,Object& _val){
	List<Object>::iterator flag2=_list.begin();	
	while(1){
		if(*flag2==_val){
			return flag2;
		}
		if(flag2==_list.end()){
			cout<<"not found"<<endl;
			return _list.begin();
		}
		flag2++;
	}	
	
}